﻿@model IEnumerable<DFYE.Web.Models.student>
@using JULONG.WEB.Library
@{
    ViewBag.Title = "Index";
}

@{
    ViewBag.Title = "文档";
    paging paging = new paging();
    paging.pageSize = 15;
    dynamic pagingMode;
    var vModel = paging.content(
        Model.OrderBy(d=>d.name),
        out pagingMode, Html.getRoute("page").As<int>()
        );
    ViewBag.paging = pagingMode;
}
<h2>学生列表</h2>

<p>
    @Html.ActionLink("新建", "Create")
</p>
<table>
    <tr>
        <th>
            姓名
        </th>

        <th>
            有效
        </th>

        <th>
            最近修改时间
        </th>

        <th>
            性别
        </th>


        <th>
            可访问
        </th>
        <th>
            操作
        </th>
        <th></th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.name)
        </td>

        <td>
            @Html.DisplayFor(modelItem => item.able)
        </td>

        <td>
            @Html.DisplayFor(modelItem => item.lastDate)
        </td>

        <td>
            @(item.sex?"男":"女")
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.isOpen)
        </td>
        <td>
            <a href="/manage/studentDaily/index/@item.ID">看日志</a>
            <a href="/manage/guestbook/index/@item.ID">看留言</a>
        </td>
        <td>
            @Html.ActionLink("修改", "Edit", new { id = item.ID }) |
            @Html.ActionLink("删除", "Delete", new { id = item.ID })
        </td>
    </tr>
}

</table>
@Html.Partial("paging", new { action = "Index" })